import request from '@/config/axios'

export default {
  // 上传文件
  async uploadFile(data, params) {
    return await request.post({
      url: `/infra/file/upload`,
      data,
      params
    })
  },
  // 获取党员信息
  async getPartyList() {
    return await request.get({
      url: `/countryside/party-member/get-partyMember-list`,
    })
  },
  // 获取居民信息
  async getResidentList() {
    return await request.get({
      url: `/countryside/dv_affairs/resident_record/list-all-simple`,
    })
  },
  // 获取居民详情信息
  async getResidentDetail(params) {
    return await request.get({
      url: `/countryside/dv_affairs/resident_record/get`,
      params
    })
  },
  // 获取字典列表
  async getDictData(params) {
    return await request.get({
      url: `/system/dict-data/page`,
      params
    })
  },
  // 新增/修改字典数据
  async operateDictData(type, data) {
    const method = type === 'create' ? 'post' : 'put'
    return await request[method]({
      url: `/system/dict-data/${type}`,
      data
    })
  },
  // 删除字典数据
  async delDictData(params) {
    return await request.delete({
      url: `/system/dict-data/delete`,
      params
    })
  }
}
